package com.fau.cm.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.json.simple.JSONAware;
import org.json.simple.JSONObject;

/**
 * @desc 中继表
 * @author liy
 * @datetime 2014年12月10日,下午10:36:23
 */
@Entity
@Table(name = "medical_call_relay")
public class MedicalCallRelay implements Serializable,JSONAware {

	private static final long serialVersionUID = 373582356724181161L;
	
	private String id;
	private String relayId;	// 软交换中继Id
	private String name;	// 名称
	
	@Id
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@GeneratedValue(generator = "generator")
	@Column(name = "id", length = 32)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "relay_id", length = 32)
	public String getRelayId() {
		return relayId;
	}

	public void setRelayId(String relayId) {
		this.relayId = relayId;
	}

	@Column(name = "name", length = 20)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@SuppressWarnings("unchecked")
	@Override
	public String toJSONString() {
		JSONObject jsonObject = new JSONObject();
		jsonObject.put("id", id);
		jsonObject.put("relayId", relayId);
		jsonObject.put("name", name);
		return jsonObject.toString();
	}

}
